Skip to content

ci: release packages with changesets and npm trusted publishing - #127

Merged
Julien-R44 merged 3 commits into
mainfrom
ci/changesets-release
Nov 11, 2026
Merged

Julien-R44 merged 3 commits into
mainfrom
ci/changesets-release

Conversation

@Julien-R44

Copy link
Copy Markdown
Owner

Summary

Adds .github/workflows/release.yml, which releases packages from main with changesets/action v2 and npm trusted publishing (OIDC). No npm token is needed. It follows the trusted publishing setup from the Changesets docs. Each push to main runs these jobs:

  1. select-mode decides what to do: version when changesets are pending, publish when a package version is missing from npm, otherwise nothing.
  2. version opens or updates a chore: release pull request. That pull request contains the version bumps and CHANGELOG entries from changeset version.
  3. pack builds the workspace and runs changeset pack. This step does not have id-token.
  4. publish publishes the tarballs with id-token: write, then pushes git tags and creates GitHub releases.

The workflow uses pnpm from the packageManager field and Node 24. The repository-level permissions is {}, and only the publish job can get an OIDC token.

Before merging

  • On npmjs.com, add a Trusted Publisher for bentocache, @bentocache/otel and @bentocache/plugin-prometheus. Use repository Julien-R44/bentocache, workflow release.yml and no environment.
  • In the repository settings, under Actions > General, enable Allow GitHub Actions to create and approve pull requests.

What happens after merge

Three changesets for @bentocache/otel are pending on main. The first run opens a chore: release pull request that bumps @bentocache/otel to 0.2.0. Merging that pull request publishes @bentocache/otel@0.2.0. bentocache 1.6.1 and @bentocache/plugin-prometheus 0.2.0 are already on npm, so they are skipped.

Pull requests opened by GITHUB_TOKEN do not trigger CI. You can run CI on the release pull request manually, or later give the version job a GitHub App token.

Verification

  • actionlint reports no issues.
  • I ran changeset publish-plan and changeset pack locally with @bentocache/otel bumped to 0.2.0. The plan contains only @bentocache/otel@0.2.0. In the tarball, workspace:* is replaced and build/ is included.
  • I have not run the workflow itself yet. It runs for the first time on merge.

Add a release workflow on main. While changesets are pending, it opens or
updates a "chore: release" pull request. Once that pull request is merged, it
packs the packages whose version is not on npm yet and publishes them with npm
trusted publishing (OIDC), then creates git tags and GitHub releases. Only the
publish job gets id-token: write.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1cc89-88ff-735a-b0e6-546b99965804
@changeset-bot

changeset-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a7268d8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Deploying bentocache with  Cloudflare Pages  Cloudflare Pages

Latest commit: a7268d8
Status:🚫  Build failed.

View logs

A tag invalidation counts entries created in the same millisecond as
invalidated. When cache3 recomputed baz in the same millisecond as the
invalidation of tag x, the next read invalidated it again and returned 3333
instead of 333. Wait after the invalidation, as the neighbouring test does.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1cc89-88ff-735a-b0e6-546b99965804
@Julien-R44
Julien-R44 merged commit d4aa55f into main Nov 11, 2026
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant